GrapeCity.Win.MultiRow Namespace > Template Class > CreateGridTemplate Method : CreateGridTemplate(IEnumerable<Cell>,Int32,AutoGenerateGridTemplateStyles) Method |
Public Overloads Shared Function CreateGridTemplate( _ ByVal cells As IEnumerable(Of Cell), _ ByVal columnsMaxWidth As Integer, _ ByVal autoGenerateGridTemplateStyles As AutoGenerateGridTemplateStyles _ ) As Template
Dim cells As IEnumerable(Of Cell) Dim columnsMaxWidth As Integer Dim autoGenerateGridTemplateStyles As AutoGenerateGridTemplateStyles Dim value As Template value = Template.CreateGridTemplate(cells, columnsMaxWidth, autoGenerateGridTemplateStyles)
public static Template CreateGridTemplate( IEnumerable<Cell> cells, int columnsMaxWidth, AutoGenerateGridTemplateStyles autoGenerateGridTemplateStyles )
Exception | Description |
---|---|
System.ArgumentNullException | The cells parameter is a null reference (Nothing in Visual Basic). |
System.ArgumentOutOfRangeException | The columnsMaxWidth is less than or equal to 0. |
System.ComponentModel.InvalidEnumArgumentException | The autoGenerateGridTemplateStyles value is not a valid AutoGenerateGridTemplateStyles value. |
System.ArgumentException | There exists one cell in cells that is a null reference (Nothing in Visual Basic). -or- There exists one cell in cells that has been added to another Section or Template. -or- There are no cells in cells. |
System.InvalidOperationException | There exists one cell in cells that cannot be added to the Row section. |
void SetFourth_Click(object sender, EventArgs e) { NumericUpDownCell numericUpDownCell1 = new NumericUpDownCell(); numericUpDownCell1.Value = 0; NumericUpDownCell numericUpDownCell2 = new NumericUpDownCell(); numericUpDownCell2.Value = 16m; Template template1 = Template.CreateGridTemplate(new Cell[] { numericUpDownCell1, numericUpDownCell2 }, Int32.MaxValue, AutoGenerateGridTemplateStyles.ColumnHeader | AutoGenerateGridTemplateStyles.RowHeaderAutoNumber, 50); template1.ColumnHeaders[0].Cells[0].Value = "Column1"; template1.ColumnHeaders[0].Cells[1].Value = "Column2"; gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 10; }
Private Sub SetFourth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setFourth.Click Dim numericUpDownCell1 As New NumericUpDownCell() numericUpDownCell1.Value = 0 Dim numericUpDownCell2 As New NumericUpDownCell() numericUpDownCell2.Value = 16D Dim template1 As Template = Template.CreateGridTemplate(New Cell() {numericUpDownCell1, numericUpDownCell2}, Int32.MaxValue, AutoGenerateGridTemplateStyles.ColumnHeader Or AutoGenerateGridTemplateStyles.RowHeaderAutoNumber, 50) template1.ColumnHeaders(0).Cells(0).Value = "Column1" template1.ColumnHeaders(0).Cells(1).Value = "Column2" gcMultiRow1.Template = template1 gcMultiRow1.RowCount = 10 End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
Template Class
Template Members
Overload List
CreateGridTemplate(Int32) Method
CreateGridTemplate(Int32,Int32,Int32) Method
CreateGridTemplate(Int32,Int32,Int32,Int32) Method
CreateGridTemplate(Int32,Int32,Int32,Int32,AutoGenerateGridTemplateStyles) Method
CreateGridTemplate(Int32,Int32,Int32,Int32,AutoGenerateGridTemplateStyles,Int32) Method
CreateGridTemplate(IEnumerable<Cell>) Method
CreateGridTemplate(IEnumerable<Cell>,Int32) Method
CreateGridTemplate(IEnumerable<Cell>,Int32,AutoGenerateGridTemplateStyles,Int32) Method